package com.test2;

import com.test.Res;

/****
 * 输入线程资源
 *
 */
public class IntThrad  extends Thread {
	public Res res;

	public IntThrad(Res res) {
		this.res = res;
	}

	@Override
	public void run() {
		int count = 0;
		while (true) {
			synchronized (res) {
				if (count == 0) {
					res.userName = "小军";
					res.userSex = "男";
				} else {
					res.userName = "小紅";
					res.userSex = "女";
				}
			   }
			count = (count + 1) % 2;
			}
	}
}
